<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <p>修饰符——按键修饰符，按下某个(某些)键才会执行代码</p>
    <p>修饰符可以串联使用，.ctrl.q表示同时ctrl和q两个按键</p>
    <p>可以用的按键名：26字母、up、down/left/right/enter/ctrl/shift...</p>
    <p>获取按键的数值：e.keyCode</p>
    <input type="text" v-model="msg1" @keyup.ctrl.q="showVal">
    <input type="text" @keyup.down="log">
    <p>{{msg1}}</p>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg1: ''
      },
      methods: {
        showVal() {
          console.log(this.msg1);
          // console.log(e.keyCode);
        },
        log() {
          console.log(666);
        }
      },
    })
  </script>
</body>
</html>